home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fritz: All Fritz
/
All Fritz.zip
/
All Fritz
/
FILES
/
UTILREEN
/
EGA2RAM.LZH
/
EGA2RAM.DOC
< prev
next >
Wrap
Text File
|
1988-03-13
|
9KB
|
210 lines
Version 1.00 EGA²RAM 13 March 1988
------------------------------------------------------------------
EGA²RAM is yet another entry in my amazingly popular series of EGA
enhancement programs (I like them, anyway). This particular program
was inspired by the recent announcements by Compaq, Quarterdeck and
others of so-called "shadow RAM" products. Basically, the idea is to
copy the BIOS code from slow ROM to fast RAM. Since most EGA cards
are designed to fit the least common denominator, i.e. 8-bit PC and
XT slots, one can achieve remarkable improvements in performance on
(16-bit) AT and (32-bit) 386 machines. [It may be that performance
improves a little on plain-jane PCs, too, simply because the RAM is
slightly faster than ROM; I haven't tested this].
HOW TO USE IT:
--------------
EGA²RAM is written as a device driver and as such is loaded at boot
time by a statement in your CONFIG.SYS file:
device = EGA2RAM.SYS (assuming it's in your
root directory)
EGA²RAM should be loaded BEFORE any other drivers which mess with
the video routines, in particular ANSI.SYS and any Microsoft-compat-
ible mouse drivers. If in doubt, just load EGA²RAM first; it will
create no compatibility problems that are not already present with
the EGA BIOS. EGA²RAM uses 14,832 bytes of RAM (like all device
drivers, it is RAM-resident), and works only with IBM's EGA -- it
won't load unless it finds IBM's identification (read on for alter-
natives, though).
HOW FAST IT IS:
---------------
I tested EGA²RAM on a 9 MHz IBM AT with IBM's EGA card (it had 128k
on it, but that shouldn't matter any). I used PC Magazine's bench-
mark series (version 4.01), with the following results:
TEST REGULAR BIOS EGA²RAM BIOS % IMPROVEMENT IN SPEED
---- ------------ ------------ ----------------------
No scrolling: 7.53 sec 3.90 sec 93%
Scrolling: 10.97 sec 7.27 sec 51%
Direct write: 7.90 sec 7.87 sec .4%
Line pattern: 36.5 sec 19.4 sec 88%
All times given are the average of three trials, and the last test
was timed using a stop watch (so is accurate to only +/- .1 sec).
Note that the direct write to display memory, since it bypasses the
BIOS completely, shows no improvement. However, the other tests
page 2
show a remarkable 50 to 100% improvement!!! On a 32-bit 386 machine
the results should be even more striking (100 to 200%, I would guess).
I have (obviously) installed EGA²RAM on my system, and the speedup is
quite noticeable in ordinary DOS tasks such as directory listings
and so forth. Programs such as Microsoft WORD and Borland's SIDEKICK
will not benefit much since they write directly to memory, but "well-
behaved" programs which use the BIOS interface for video things will
seem livelier.
TECHNICAL DETAILS, ETC.
-----------------------
First of all, EGA²RAM does NOT contain a copy of the EGA BIOS; it
simply copies what is already in your machine (so I'm not violating
any copyrights or anything). Just copying the BIOS to RAM doesn't
get you anything, though; it is necessary to tell the machine to use
the RAM copy instead of the one in ROM. This is where things begin
to get a bit complicated. Clearly we must fix up the INT 10h video
interrupt; as it happens, the EGA also uses several others, namely
interrupts 1Fh, 42h, 43h, and 44h. Of these latter four, however,
only 1Fh and 43h actually point to the EGA BIOS (at least in IBM's
version -- more on that later), so there are really only three in-
terrupts to re-vector. In addition, there is a pointer in low memory
(address 0:04A8h) to a table in the BIOS which itself points to some
other tables in BIOS. The latter tables initially contain only the
parameter settings for each EGA video mode, but they may be altered
by the user to also include custom font and palette information.
This is how programs such as KCSETPAL (Kent Cedola), SPECTRUM and
EGAITAL (PC Magazine), and WORD (Microsoft) work. So actually there
are only two addresses to worry about besides the interrupts, the
one at 0:04A8h and the first entry in the table that is pointed at
by 0:04A8h. (Confused yet? Good.)
The conclusions in the previous paragraph are only valid if two fur-
ther things hold: (1) no other programs have fooled around with the
video interrupts/addresses before EGA²RAM, and (2) the EGA BIOS in
question is IBM's. The first stipulation is obvious but not trivial:
clearly TSR programs ("pop-ups") such as SIDEKICK, SUPERKEY, and my
own EGA²LQ are likely culprits and should be loaded after EGA²RAM;
but what about device drivers which do the same thing? ANSI.SYS is
a good candidate; but surprisingly enough, your mouse driver might
be just as guilty. In particular, Microsoft's MOUSE.SYS and any
Microsoft-compatible drivers (e.g. Mouse Systems' MSMOUSE.SYS) also
hook into interrupt 10h, for reasons I won't go into here. The upshot
of all this is that EGA²RAM cannot simply be loaded as an ordinary
TSR -- it has to be loaded *before* any other video-stealing routines,
which is why it is written as a device driver.
The second stipulation, that the BIOS be IBM's, is perhaps not so
strict. I think EGA²RAM is reasonably BIOS-independent, but since
I only have an IBM EGA with which to work, I couldn't check this.
For this reason I have included the source code to EGA²RAM. Hardy
assembly language programmers can check their own interrupt table and
page 3
BIOS to make sure there are no extra references to the C000h segment
where the EGA BIOS resides; if any are found, I expect it shouldn't
be too much trouble to change the program (I would appreciate hearing
about any such findings, though). [You'll probably have to change
the number of bytes to transfer based on the length of your BIOS code
-- it shouldn't be more than 16k in any case.] Or, if you feel a bit
daring (and don't mind the possibility of crashing up your machine),
you can just patch the driver with DEBUG or SYMDEB as follows:
DEBUG EGA2RAM.SYS (at the DOS prompt)
F 3B1B L2 EB 22 (at the DEBUG prompt, a dash (-))
N EGATEST.SYS (name of the patched driver)
W (write it to disk)
Q (exit from DEBUG)
Then load it in your CONFIG.SYS file as discussed above (device =
egatest.sys) and reboot your machine. If it boots normally, fine!
You're all set. If your display is blank or garbled, well, sorry,
your BIOS isn't that compatible. And if you hear a high-pitched
squeal from your monitor or anything else unusual, TURN IT OFF IMMEDI-
ATELY!!! [While there is almost no chance this will happen, it IS
possible to damage or destroy a color monitor by sending it monochrome
signals, or a mono monitor by sending color signals. Any modifications
to EGA²RAM are at your own risk. But speaking personally, I find the
risks are low enough that not only would I take the chance, I *have*
in the past (with my own equipment), and have never sustained any
damage of any sort, even when the above situation *did* occur.... Of
course, I turned the thing off pretty damn quick, too....]
Lest any of the foregoing scare anyone off, let me emphasize that
the old video BIOS is still there regardless; the worst that is likely
to happen is that you will miss a pointer to something, so that part
of the time you are still using the (slower) ROM BIOS. The actual
code is unchanged, however, so a slight decrease in performance is the
only penalty I can think of.
-----------------------
This program is free to all; the only thing I ask is that it not be
sold or used for any other commercial purpose, and that any modifications
that might be made are *specifically noted* in some form of documentation,
along with the name of whomever made the change. (I, of course, will not
decline any recompense that might come my way, but there is absolutely no
obligation in this regard).
Questions and comments are not only accepted but actively encouraged,
especially if you make the patch suggested above for non-IBM boards, and
it works. Feel free to drop me a line at:
Greg Roelofs
Amazingly Nifty Computer Stuff, Inc.
5433 S. Cornell Ave. #3N
Chicago, IL 60615
Or, leave me a note on either the Chicago Computer Society BBS (312-942-
0706) or Loren Jones's Chicago Board (312-352-1035).
page 4
And, by the way, my only connection with the University of Chicago is
that of graduate student; the University had nothing to do with this
program should not be considered particularly responsible for the way
it, or I, turned out.
-----------------------
EGA²RAM is provided as is; the user accepts any liability, etc., and
all that stuff.